package com.csmzxy.dto;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class JsonResult<T> implements Serializable {

    private boolean result;

    private int code;

    private String msg;

    private List<T> dataList;

    private T data;

    public JsonResult() {
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public List<T> getDataList() {
        return this.dataList;
    }

    public void setDataList(List<T> dataList) {
        this.dataList = dataList;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public boolean isResult() {
        return this.result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public boolean equals(Object o) {
        if(this == o) {
            return true;
        } else if(o != null && this.getClass() == o.getClass()) {
            JsonResult that = (JsonResult)o;
            return this.result == that.result && this.code == that.code && Objects.equals(this.msg, that.msg) && Objects.equals(this.dataList, that.dataList) && Objects.equals(this.data, that.data);
        } else {
            return false;
        }
    }

    public int hashCode() {
        return Objects.hash(new Object[]{Boolean.valueOf(this.result), Integer.valueOf(this.code), this.msg, this.dataList, this.data});
    }
}
